<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            var list = [1];

            function fn(arr) {
                let a = new Array(arr.length + 2);

                if (arr.length < 2) {
                    return [];
                }
                let first = arr[0];
                let len = arr.length;

                let unList = [];

                for (let index = 0; index < len; index++) {
                    let cur = arr[0] + index;
                    console.log(cur);
                    if (cur != arr[index] && unList.length < 2) {
                        console.log(cur, arr[index]);
                        unList.push(cur);
                    }
                }
                console.log(unList);

                if (unList) return unList;
            }

            let array = fn(list);
            console.log(array);
        </script>
    </body>
</html>
